package com.yiren.dbaa.module.practice_set.carmodel.contract;

import com.yiren.backstage.currency.bean.GpsInfoBean;
import com.yiren.backstage.currency.bean.PointExBean;
import com.yiren.backstage.currency.entity.CarModelEntity;
import com.yiren.dbaa.currency.api.CommonCallBack;
import com.yiren.dbaa.module.practice_set.carmodel.view.CarMapView;

import java.util.List;

/**
 * Describe
 *
 * @author WRX
 * @date 2022/12/7
 */
public interface CarModelCollectContract {

    interface Model {

        /**
         * 修正除0点外的其它点位(修正车辆模型点位  修正时要讲后天线放在0点位置)
         *
         * @param carModelPoints
         */
        void fixOtherModelPoint(List<PointExBean> carModelPoints, GpsInfoBean gps);

        /**
         * 根据半径修正车辆模型点位(这里只修正车身周围的点)
         *
         * @param carModelPoints
         * @param radius
         */
        void fixPointByRadius(List<PointExBean> carModelPoints, float radius, CommonCallBack callBack);

        /**
         * 保存车辆模型点位到数据库
         * @param carModelPoints
         */
        void saveCarModel(CarModelEntity carModel, List<PointExBean> carModelPoints);
    }

    interface View {

        /**
         * 显示将后天线摆放到零点对话框
         */
        void showZeroPointDialog();
    }

    interface Presenter {

        /**
         * 是否能点击ABCD四点采集
         *
         * @param carModelPoints
         */
        boolean isCanCollectABCD(List<PointExBean> carModelPoints);

        /**
         * 是否可恢复
         *
         * @param carModelPoints
         * @return
         */
        void initParameter(List<PointExBean> carModelPoints, View view);

        /**
         * 是否可恢复
         *
         * @param carModelPoints
         * @return
         */
        boolean isCanRecover(List<PointExBean> carModelPoints);

        /**
         * 是否可修正
         *
         * @param zeroPoint
         */
        boolean isCanFix(PointExBean zeroPoint);

        /**
         * 返回点位是否全部采集完成  除0点外
         *
         * @param carModelPoints
         * @return
         */
        boolean isPointCollect(List<PointExBean> carModelPoints);

        /**
         * 恢复车辆点位 (将角度、长度转换成坐标系    恢复时后天线要在0点位置)
         *
         * @param carModelPoints
         * @param gps
         */
        void recoverCarModelPoint(List<PointExBean> carModelPoints, GpsInfoBean gps);

        /**
         * 恢复点位ABCD (将角度、长度转换成坐标系    恢复时后天线要在0点位置)
         *
         * @param point
         * @param gps
         */
        void recoverPointABCD(PointExBean point, int pointIndex, GpsInfoBean gps, CarMapView carMapView);

        /**
         * 修正点位ABCD
         *
         * @param point
         * @param pointIndex
         * @param gps
         * @param carMapView
         */
        void fixPointABCD(PointExBean originPoint, PointExBean point, int pointIndex, GpsInfoBean gps, CarMapView carMapView);

        /**
         * 修正车辆模型点位
         *
         * @param carModelPoints
         * @param radius
         */
        void fixCarModelPoint(List<PointExBean> carModelPoints, float radius, GpsInfoBean gps, CarModelEntity carModel);
    }
}
